﻿using System.Runtime.Serialization;
using System.Windows.Media.Media3D;
namespace GameBoard
{
    /// <summary>
    /// Used to differentiate between any placed rectangles and the pieces
    /// used by the moveable images.
    /// </summary>
    [DataContract]
    public class PictureVisualFactory : BaseVisualFactory, IChangeLocations
    {
        public PictureVisualFactory(PictureVisualData d) : base(d)
        {
        }

        public override ModelVisual3D MakeVisual()
        {
            var madePicture = new PictureVisual();
            madePicture.PopulateVisualData(VisualData);
            return madePicture.VisualElement;
        }

        public void SetLocation(Point3D newLocation)
        {
            var data = VisualData as PictureVisualData;
            data.Origin = newLocation;
        }
    }
}